import os, sys


def svncpy(src, dst):
	for root, dirs, files in os.walk(src):
		if '.svn' in dirs:
			dirs.remove('.svn')
		for dirname in dirs:
			op = os.path.join(root, dirname)
			np = op.replace(src, dst)
			if not os.path.exists(np):
				os.mkdir(np)
		for filename in files:
			ofp = os.path.join(root, filename)
			nfp = ofp.replace(src, dst)
			if not os.path.exists(nfp) or os.stat(ofp).st_mtime > os.stat(nfp).st_mtime:
				cmd = 'copy "%s" "%s"' % (ofp, nfp)
				os.system(cmd)
				print ofp

if __name__ == '__main__':
	#src = raw_input("SRC: ")
	#dst = raw_input("DST: ")
	src = 'D:\\Work\\SVN\\CIMCLI\\trunk'
	dst = 'D:\\Work\\SVN\\storage-smis-sms\\MS-SMIS'
	svncpy(src, dst)
	raw_input("Done!")